package com.smday.tree;

import java.util.Iterator;

/**
 * @author Summerday
 */
public class TestBST {
    public static void main(String[] args) {

        BST<Integer> tree = new BST<>();

        tree.insert(50);
        tree.insert(33);
        tree.insert(80);
        tree.insert(45);
        tree.insert(1);
        tree.insert(3);
        tree.insert(4);
        tree.insert(23);
        BST.TreeNode<Integer> root = tree.getRoot();
        System.out.println(root);

        System.out.println("inorder : ");
        tree.inOrder();
        System.out.println();

        System.out.println("preOrder : ");
        tree.preOrder();
        System.out.println();
        System.out.println("post Order: ");
        tree.postOrder();
        System.out.println();

        System.out.println("inorder(iterator) : ");
        Iterator<Integer> iterator = tree.iterator();
        while(iterator.hasNext()){
            System.out.print(iterator.next()+" ");
        }


    }
}
